﻿@using MileageStats.Web.Models
@model IEnumerable<FillupListViewModel>

<dl class="fillup widget">

@foreach (var item in Mustache.Loop(m => m))
{
    <dt><h2><a href="#">@Mustache.Value(item, m => m.Month) @Mustache.Value(item, m => m.Year)</a></h2></dt>
    <dd>
		<table>
            <thead><tr><th>Date</th><th>Location</th><th>Cost</th></tr></thead>
            @foreach(var fillup in Mustache.Loop(item, m => m.Fillups))
            {
                var url = Url.UnencodedAction("Details", "Fillup", new { id = Mustache.Value(fillup, m => m.FillupEntryId) });
                <tr>
                    <td><a href="@url">@Mustache.Value(fillup, m => m.Date)</a></td>
                    <td><a href="@url">@Mustache.Value(fillup, m => m.Vendor)</a></td>
                    <td><a href="@url">@Mustache.Value(fillup, m => m.TotalCost)</a></td>
                </tr>
            }
		</table>
	</dd>
}
</dl>